<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>申请减免罚息</title>
    <link rel="stylesheet" type="text/css" href="/Public/css/gxxj/normalize.css">
    <link href="/Public/css/animate.css" rel="stylesheet">

    <link rel="stylesheet" type="text/css" href="/Public/css/gxxj/public_O.css">
    <link rel="stylesheet" type="text/css" href="/Public/css/gxxj/workorder.css">
    <link href="/Public/Widget/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css"/>
    <style>
        .sc {
            width: 900px;
            height: 300px;
            margin-top: 20px;
            margin-bottom: 20px;
            margin-left: 100px;
        }

        .uploader-list-container .placeholder {
            min-height: 100px;
            padding-top: 140px;
        }
    </style>
</head>
<body>
<div class="workorderBox animated fadeInRight">
    <div class="addOrderBox">
        <form method="post" onsubmit="return false">
            <ul>

                <li>
                    <div class="fl orderInfo">
                        <span>申请减少金额</span>
                        <input type="text" name="title" id="money" placeholder="请填写金额" class="width_type2">

                    </div>

                    <div class="clear"></div>
                </li>
                <li>

                    <div class="fl orderInfo">
                        <span>申请理由</span>
                        <textarea name="content" id="reason" class="areabox width_type2"
                                  placeholder="请填写申请理由"></textarea>
                    </div>
                </li>

            </ul>
            <input type="submit" onclick="apply()" class="submit_order" value="确认申请">
        </form>
    </div>
</div>
<!-- 全局js -->
<script src="/Public/js/jquery.min.js?v=2.1.4"></script>
<script src="/Public/js/layer/layer.js"></script>
<script src="/Public/js/layui/layui.js"></script>
<script>
    function apply() {
        var index = layer.load(1, {
            shade: [0.1, '#fff'] //0.1透明度的白色背景
        });
        var url = "<{$SERVER_NAME}>/User/reduce_fine";
        var money = $("#money").val();
        var reason = $("#reason").val();

        var overdue_no = "<{$overdue_no}>";
        var repayment_no = "<{$repayment_no}>";
        if (reason == "" || money == "") {
            layer.close(index);
            layer.alert("请信息填写完整！\r\n", {
                title: '提示框',
                icon: 0,
            });
            return false;
        }

        $.post(url, {repayment_no: repayment_no, money: money, overdue_no: overdue_no, reason: reason}, function (data) {
            console.log("11111111",data);
            if (data.code == "1001") {
                layer.alert('提交成功', {title: '提示框', icon: 1}, function () {
                    var index1 = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index1);
                    parent.location.reload();
                });
            }
            else {
                layer.alert(data.result, {title: '提示框', icon: 2});
                layer.close(index);
            }
        });

        layer.close(index);
    }

</script>
</body>
</html>